﻿@model List<ManyToManyEntityFramework.Models.HomeIndexViewModel>

@Html.ActionLink("Students", "Index", "Student")
<br />
@foreach (var c in Model)
{
    <div class="well">
        @Html.LabelFor(j => c.Name): @c.Name
        @Html.LabelFor(j => c.NumCredits): @c.NumCredits
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>Student Name</th>
                    <th>Grade</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var s in c.Students)
                {
                    <tr>
                        <td>@s.Name</td>
                        <td>@s.Grade</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
}